import Cookies from 'js-cookie'

const TokenKey = 'tokenKeyAdmin'

/**
 * 获取Token
 */
export function getToken(tokenName='') {
  if(tokenName != ''){
    return Cookies.get(tokenName)
  }else{
    return Cookies.get(TokenKey)
  }
}

/**
 * 设置Token
 */
export function setToken(token,tokenName='') {
  if(tokenName != ''){
    return Cookies.set(tokenName, token)
  }else{
    return Cookies.set(TokenKey, token)
  }
}

/**
 * 删除Token
 */
export function removeToken(tokenName='') {
  if(tokenName != ''){
    return Cookies.remove(tokenName)
  }else{
    return Cookies.remove(TokenKey)
  }
}
